// 仓储作业
import qs from 'qs';
/* 通道管理接口 */
import request from '@/utils/request';
import { rsaEncrypt } from '@/utils/commonUtil3';
// 获取仓库区域级联选择器
export const reqRegionList = () => request({ url: '/warehouse/select', method: 'GET' });
// 获取通道列表
export const reqAisleList = data => request({ url: '/warehouseAisle/selectByGroup', method: 'GET', params: { ...data } });
// 添加通道
export const reqAddAisle = data => request({ url: '/warehouseAisle/insert', method: 'POST', data: { data: rsaEncrypt(data) } });
// 修改通道
export const reqEditAisleById = data => request({ url: '/warehouseAisle/update', method: 'PUT', data: { data: rsaEncrypt(data) } });
// 删除通道
export const reqDelAisleById = data => request({ url: '/warehouseAisle/delete', method: 'DELETE', data: { data: rsaEncrypt(data) } });
// 批量删除
export const reqDelMoreAisle = data => request({ url: '/warehouseAisle/batchDelete', method: 'DELETE', data: { data: rsaEncrypt(data) } });

// 根据仓库id获取区域
export const reqRegionListByWarehouseId = data => request({ url: '/warehouse/region/selectByWarehouse', method: 'GET', params: { ...data } });
// 添加通道组
export const reqAddAisleGroup = data => request({ url: '/aisleGroup/insert', method: 'POST', data: { data: rsaEncrypt(data) } });
// 删除通道组
export const reqDelAisleGroupById = data => request({ url: '/aisleGroup/delete', method: 'DELETE', data: { data: rsaEncrypt(data) } });
// 根据区域查询通道组
export const reqAisleGroupList = data => request({ url: '/aisleGroup/selectByRegion', method: 'GET', params: { ...data } });
// 根据区域查询通道组简单数据
export const reqAisleGroupListInfo = data => request({ url: '/aisleGroup/getByRegion', method: 'GET', params: { ...data } });
// 通道移位
export const reqMoveAisle = data => request({ url: '/warehouseAisle/move', method: 'PUT', data: { data: rsaEncrypt(data) } });
// 修改通道组
export const reqEditAisleGroupById = data => request({ url: '/aisleGroup/update', method: 'PUT', data: { data: rsaEncrypt(data) } });
// 根据通道获取仓位
export const reqPositionByAisle = data => request({ url: '/warehouse/position/selectByAisle', method: 'GET', params: { ...data } });
// 根据通道组获取通道信息
export const reqAisleByAisleGroupId = data => request({ url: '/warehouseAisle/getByGroup', method: 'GET', params: { ...data } });
// 仓位移位
export const reqPositionMove = data => request({ url: '/warehouse/position/move', method: 'PUT', data: { data: rsaEncrypt(data) } });

// 盘点根据仓库获取区域列表
export const reqRegionListByWarehouseIdForCheck = data => request({ url: '/warehouse/region/selectByStocktaking', method: 'GET', params: data });

// 盘点根据区域id获取通道
export const reqAisleListByRegionIdForCheck = data => request({ url: '/warehouseAisle/selectByStocktaking', method: 'GET', params: data });

//根据通道获取仓位商品信息
export const reqPositionGoodsInfoByAisleId = params => request({ url: '/stocktaking/selectByAisleId', params, method: 'GET' });

// 新增盘点
export const reqAddStocktaking = data => request({ url: '/stocktaking/insert', method: 'POST', data: { data: rsaEncrypt(data) } });

// 分页查询盘点列表
export const reqCheckInfoList = data => request({ url: '/stocktaking/select', method: 'GET', params: data });

// 打印盘点单
export const reqPrintCheckInfo = data => request({ url: '/stocktaking/print', method: 'GET', params: data });

// 根据盘点id获取盘点详情
export const reqCheckInfoDetail = data => request({ url: '/stocktaking/selectDetails', method: 'GET', params: data });

// 盘点订单
export const reqUpdateCheckInfo = data => request({ url: '/stocktaking/update', method: 'PUT', data: { data: rsaEncrypt(data) } });
// 删除盘点记录
export const reqDeleteCheckInfo = data => request({ url: '/stocktaking/delete', method: 'DELETE', data: { data: rsaEncrypt(data) } });
// 仓位地图获取仓库信息
export const reqWarehouseInfo = data => request({ url: '/warehouse/selectWarehouseInfo', method: 'GET', params: data });
// 仓位地图获取仓位信息
export const reqPositionInfo = data => request({ url: '/warehouse/position/selectPositionInfo', method: 'GET', params: data });

// 批量添加仓位
export const reqBatchAddPosition = data => request({ url: '/warehouse/position/batchInsert', method: 'POST', data: { data: rsaEncrypt(data) } });
